package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author 楚夏三分
 * @datetime 2022/12/26 22:34
 * @description: TODO: 实现用户登录响应信息
 */
@RestController
@RequestMapping("user")
public class UserController {

    @RequestMapping("login/{username}")
    public BaseRespVo login(@PathVariable("username")String username,
                            HttpSession session){
        session.setAttribute("username",username);
        return BaseRespVo.ok("login ok");
    }

    @RequestMapping("hello")
    public BaseRespVo hello(){
        return BaseRespVo.ok("hello ok");
    }


}
